package com.bolovan.infovaluta.util;

import java.io.IOException;

import com.bolovan.infovaluta.bean.ExchangeRateSeller;

import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

public class ExchangeRateSellerAdapter<T> extends TypeAdapter<T> {

    public void write(JsonWriter out, T value) throws IOException {
         if (value == null) {
              out.nullValue();
              return;
         }
         ExchangeRateSeller seller = (ExchangeRateSeller) value;
         out.beginObject();
         out.name("name");
         out.value(seller.name());
         out.name("id");
         out.value(seller.getId());
         out.name("url");
         out.value(seller.getUrl());
         out.name("baseCurrency");
         out.value(seller.getBaseCurrency());
         out.endObject();
    }

    public T read(JsonReader in) throws IOException {
         return null;
    }
}